package com.dgut.ibeacon.enums;

public enum  RoleKey {

    NORMALUSER(3,"normaluser"),
    ADMIN(2,"admin"),
    SUPERADMIN(1,"superadmin");

    private int roleId;
    private String rolekey;


    RoleKey(int roleId, String rolekey) {
        this.roleId=roleId;
        this.rolekey=rolekey;
    }

    public static String findRolekey(int index) {
        for (RoleKey c : RoleKey.values()) {
            if (c.getRoleId() == index) {
                return c.getRolekey();
            }
        }
        return null;
    }

    public String getRolekey() {
        return rolekey;
    }

    public int getRoleId(){
        return roleId;
    }
}
